`include "i2c_trans.sv"

class i2c_mst_seq extends uvm_sequence #(i2c_trans);
    int   item_count = 10;

    `uvm_object_utils_begin(i2c_mst_seq)
        `uvm_field_int(item_count, UVM_ALL_ON)
    `uvm_object_utils_end

    function new(string name = "i2c_mst_seq");
        super.new(name);
        `uvm_info("TRACE", $sformatf("%m"), UVM_HIGH)
    endfunction

  virtual task body();
    uvm_config_db#(int)::get(m_sequencer, "", "item_count", item_count);

    `uvm_info("TRACE", $sformatf("%m"), UVM_HIGH)

    if (starting_phase != null) begin
      uvm_objection objection = starting_phase.get_objection();
      objection.set_drain_time(this, 1us);
      starting_phase.raise_objection(this);
    end
    // add your i2c sequence here
    repeat(item_count) begin
      `uvm_do(req)
      `uvm_do_with(req, {req.addr == 32'h0;})
      `uvm_do_with(req, {req.addr == 32'h4;})
      `uvm_do_with(req, {req.addr == 32'h8;})
      `uvm_do_with(req, {req.addr == 32'h12;})
      `uvm_do_with(req, {req.addr == 32'h16;})
    end

    if (starting_phase != null) begin
      starting_phase.drop_objection(this);
    end
 endtask

endclass